Optimal. Leaf size=157 \[ -\frac{i n (d \cot (e+f x))^{n+2} \, _2F_1\left (1,\frac{n+2}{2};\frac{n+4}{2};-\cot ^2(e+f x)\right )}{2 a d^2 f (n+2)}+\frac{(n+1) (d \cot (e+f x))^{n+3} \, _2F_1\left (1,\frac{n+3}{2};\frac{n+5}{2};-\cot ^2(e+f x)\right )}{2 a d^3 f (n+3)}-\frac{(d \cot (e+f x))^{n+2}}{2 d^2 f (a \cot (e+f x)+i a)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.254964, antiderivative size = 157, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 5, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.192, Rules used = {3673, 3552, 3538, 3476, 364} \[ -\frac{i n (d \cot (e+f x))^{n+2} \, _2F_1\left (1,\frac{n+2}{2};\frac{n+4}{2};-\cot ^2(e+f x)\right )}{2 a d^2 f (n+2)}+\frac{(n+1) (d \cot (e+f x))^{n+3} \, _2F_1\left (1,\frac{n+3}{2};\frac{n+5}{2};-\cot ^2(e+f x)\right )}{2 a d^3 f (n+3)}-\frac{(d \cot (e+f x))^{n+2}}{2 d^2 f (a \cot (e+f x)+i a)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3673
Rule 3552
Rule 3538
Rule 3476
Rule 364
Rubi steps
\begin{align*} \int \frac{(d \cot (e+f x))^n}{a+i a \tan (e+f x)} \, dx &=\frac{\int \frac{(d \cot (e+f x))^{1+n}}{i a+a \cot (e+f x)} \, dx}{d}\\ &=-\frac{(d \cot (e+f x))^{2+n}}{2 d^2 f (i a+a \cot (e+f x))}-\frac{\int (d \cot (e+f x))^{1+n} (-i a d n+a d (1+n) \cot (e+f x)) \, dx}{2 a^2 d^2}\\ &=-\frac{(d \cot (e+f x))^{2+n}}{2 d^2 f (i a+a \cot (e+f x))}+\frac{(i n) \int (d \cot (e+f x))^{1+n} \, dx}{2 a d}-\frac{(1+n) \int (d \cot (e+f x))^{2+n} \, dx}{2 a d^2}\\ &=-\frac{(d \cot (e+f x))^{2+n}}{2 d^2 f (i a+a \cot (e+f x))}-\frac{(i n) \operatorname{Subst}\left (\int \frac{x^{1+n}}{d^2+x^2} \, dx,x,d \cot (e+f x)\right )}{2 a f}+\frac{(1+n) \operatorname{Subst}\left (\int \frac{x^{2+n}}{d^2+x^2} \, dx,x,d \cot (e+f x)\right )}{2 a d f}\\ &=-\frac{(d \cot (e+f x))^{2+n}}{2 d^2 f (i a+a \cot (e+f x))}-\frac{i n (d \cot (e+f x))^{2+n} \, _2F_1\left (1,\frac{2+n}{2};\frac{4+n}{2};-\cot ^2(e+f x)\right )}{2 a d^2 f (2+n)}+\frac{(1+n) (d \cot (e+f x))^{3+n} \, _2F_1\left (1,\frac{3+n}{2};\frac{5+n}{2};-\cot ^2(e+f x)\right )}{2 a d^3 f (3+n)}\\ \end{align*}
Mathematica [F] time = 2.59343, size = 0, normalized size = 0. \[ \int \frac{(d \cot (e+f x))^n}{a+i a \tan (e+f x)} \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 0.868, size = 0, normalized size = 0. \begin{align*} \int{\frac{ \left ( d\cot \left ( fx+e \right ) \right ) ^{n}}{a+ia\tan \left ( fx+e \right ) }}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{\left (\frac{i \, d e^{\left (2 i \, f x + 2 i \, e\right )} + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} - 1}\right )^{n}{\left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{2 \, a}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (d \cot \left (f x + e\right )\right )^{n}}{i \, a \tan \left (f x + e\right ) + a}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]